<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function doCheck(){
            let loginName=document.querySelector("input[name=loginName]").value;
            if(!loginName||!loginName.trim()){
                alert("登录名不能为空");
                return false;
            }
            return true;
        }

    </script>

</head>
<body>
    <h2>登录</h2>
    <?
    $msg=$_REQUEST["msg"];
    ?>
    <div style="height: 30px;color: red;font-size: 24px;" ><?= $msg ?></div>
    <form action="login.php" onsubmit="return doCheck()" method="post">
        <div>
            <label>登录名：<input type="text" name="loginName"></label>
        </div>
        <div>
            <label>密码：<input type="password" name="password"></label>
        </div>
        <div>
            <input type="submit" value="登录">
            <input type="reset" value="重置">
        </div>
    </form>
</body>
</html>